<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="res/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="res/css/main.css">
<link rel="stylesheet" href="res/css/index.css">
<title>我的信息查看</title>
<style>
		.all {
			width: 100%;
			margin-top: 10px;
			height: 50px;
		}
		
		.lower {
			width: 100%;
			background-color: #f2f2f2
		}
		
		.select {
			font-size: 24px;
			text-align: center;
		}
		
		.tablestyle {
			width: 100%;
		}
		
		.tablestyle td {
			height: 50px;
			font-size: 18px;
			text-align: center;
			border: 1px solid #e085c2;
		}
		
		.tablestyle th {
			font-size: 20px;
			width: 10%;
			border: 1px solid #e085c2;
		}
		
		.topcenter {
			text-align: center;
			margin-top: 5px;
			font-size: 24px;
		}
		
		.label {
			float: left;
			display: block;
			padding: 9px 15px;
			width: 200px;
			font-weight: 400;
			line-height: 20px;
			text-align: right
		}
		
		#submit {
			margin-top: 15px;
			margin-left: 200px;
		}
		
		.all li {
			float: left;
			padding: 5px;
			color: #666;
			list-style: none;
			border-left: 1px solid #f4f4f4;
			cursor: pointer; /*鼠标的光标样式定义*/
		}
		
		.topstyle {
			height: 50px;
			overflow: hidden;
		}
		
		.all li:hover, .selected {
			line-height: 50px;
			border-left: 1px solid #ecebeb;
		}
		
		.content {
			border: 1px solid #f4f4f4;
			padding: 10px;
			overflow: hidden;
		}
		
		.all-list div {
			display: none;
		}
		
		.all-list div.active {
			display: block;
		}
		
		.layui-card div{
			display: block;
		}
		
		.list div{
			display: block;
		}
		
		.border {
			border-style: none;
			line-height: 37px;
		}
</style>
</head>
<body>

	<!-- 导入导航栏 -->
	<div class="layui-container" style="width:100%">
		<%@ include file="header.jsp"%>
	</div>
<c:if test="${loginuser != null}">
	<div class="layui-container all">
		<ul class="layui-nav layui-bg-blue topstyle">
			<li class="selected">我的信息</li>
			<!-- <li>我的报名</li>
			<li>我的成绩</li> -->
			<li>我的加油稿</li>
			<li>修改密码</li>
		</ul>
	</div>
</c:if>
	<div class="content layui-container all-list">
		<!-- 学生用户 -->
		<c:if test="${loginuser != null && usertype == 2}">
			<div class="list layui-row layui-col-space12 active">
				<div class="layui-card active">
					<div class="layui-card-header">
						<div>
							我的信息 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>我的角色：学生</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
					</div>
					<div class="layui-card-body">
						<form class="layui-form" lay-filter="example">
							<div class="layui-form-item">
								<label class="layui-form-label">学号:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentid" id="studentid"
										class="border" readonly="readonly"
										value="${loginuser.getAthletesid() }" class="layui-input">
								</div>

								<label class="layui-form-label">姓名:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentname" class="border"
										readonly="readonly" value="${loginuser.getStudentname() }"
										class="layui-input">
								</div>

								<label class="layui-form-label">性别:</label>
								<div class="layui-input-inline">
									<c:if test="${loginuser.getStudentagend() == 1}">
										<input type="text" name="agend" value="男" class="border"
											readonly="readonly" class="layui-input">
									</c:if>
									<c:if test="${loginuser.getStudentagend() == 2}">
										<input type="text" name="agend" value="女" class="border"
											readonly="readonly" class="layui-input">
									</c:if>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">学院:</label>
								<div class="layui-input-inline">
									<input type="text" name="college" class="border"
										readonly="readonly" value="${loginuser.getCollegename() }"
										class="layui-input">
								</div>

								<label class="layui-form-label">专业:</label>
								<div class="layui-input-inline">
									<input type="text" name="professional" class="border"
										readonly="readonly"
										value="${loginuser.getProfessionalname() }"
										class="layui-input">
								</div>

								<label class="layui-form-label">班级:</label>
								<div class="layui-input-inline">
									<input type="text" name="class"
										value="${loginuser.getClassname() }" class="border"
										readonly="readonly" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">电话:</label>
								<div class="layui-input-inline">
									<input type="text" name="mobeil" class="border"
										readonly="readonly" value="${loginuser.getStudentmobile() }"
										class="layui-input">
								</div>

								<label class="layui-form-label">年级:</label>
								<div class="layui-input-inline">
									<input type="text" name="grade" class="border"
										readonly="readonly" value="${loginuser.getGrade() }"
										class="layui-input">
								</div>

								<label class="layui-form-label">宿舍:</label>
								<div class="layui-input-inline">
									<input type="text" name="address" class="border"
										readonly="readonly" value="${loginuser.getAddress() }"
										class="layui-input">
								</div>

							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">状态:</label>
								<div class="layui-input-inline">
									<c:if test="${loginuser.getIsgraduat() == 1}">
										<input type="text" name="isgraduat" class="border" value="在校生"
											readonly="readonly" class="layui-input">
									</c:if>
									<c:if test="${loginuser.getIsgraduat() == 2}">
										<input type="text" name="isgraduat" class="border" value="已毕业"
											readonly="readonly" class="layui-input">
									</c:if>
								</div>

								<%-- <label class="layui-form-label">备注:</label>
								<div class="layui-input-inline">
									<input type="text" name="note" class="border"
										readonly="readonly" value="${loginuser.getNote() }"
										class="layui-input">
								</div> --%>

							</div>
						</form>
					</div>
				</div>
			</div>
			<%-- <div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的报名</div>
					<div class="layui-card-body">
						<input type="hidden" id="id" value="${loginuser.getAthletesid() }">
						<table id="demo2" lay-filter="test" lay-skin="nob"></table>
					</div>
				</div>
			</div>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的成绩</div>
					<div class="layui-card-body">
						<input type="hidden" id="id" value="${loginuser.getAthletesid() }">
						<table id="demo" lay-filter="test" lay-skin="nob"></table>
					</div>
				</div>
			</div> --%>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的加油稿</div>
					<div class="layui-card-body">
						<c:forEach items="${oillist }" var="oillist">
							<div>
								<ul>
									<li class="first"
										style="border-bottom: 0.1px solid #9AC0CD;height:50px;line-height:50px;">
										<a href="oneoilingshow.action?oilingid=${oillist.oilingid}">
											<span style="float:left;">【${oillist.oilingtitle }】</span> <span
											style="margin-left:200px;">发布时间：${oillist.createtime }</span>
											<c:if test="${oillist.ischeck == 1}">
												<span style="float:right;margin-right:100px;">状态：未审核</span>
											</c:if> <c:if test="${oillist.ischeck == 2}">
												<span style="float:right;margin-right:100px;">状态：已发布</span>
											</c:if>
									</a>
									</li>
								</ul>
							</div>
						</c:forEach>
					</div>
				</div>
			</div>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-body">
						<%@ include file="updatepwd.jsp"%>
					</div>
				</div>
			</div>
		</c:if>
		<!-- 教师用户 -->
		<c:if test="${loginuser != null && usertype == 3}">
			<div class="list layui-row layui-col-space12 active">
				<div class="layui-card">
					<div class="layui-card-header">
						<div>
							我的信息 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>我的角色：教师</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
					</div>
					<div class="layui-card-body">
						<form class="layui-form" lay-filter="example">
							<div class="layui-form-item">
								<label class="layui-form-label">编号:</label>
								<div class="layui-input-inline">
									<input type="text" name="teacherid" id="teacherid"
										class="border" readonly="readonly"
										value="${loginuser.getAthletesid() }" class="layui-input">
								</div>

								<label class="layui-form-label">姓名:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentid" class="border"
										readonly="readonly" value="${loginuser.getTeachername() }"
										class="layui-input">
								</div>

								<label class="layui-form-label">性别:</label>
								<div class="layui-input-inline">
									<c:if test="${loginuser.getTeacheragend() == 1}">
										<input type="text" name="agend" value="男" class="border"
											readonly="readonly" class="layui-input">
									</c:if>
									<c:if test="${loginuser.getTeacheragend() == 2}">
										<input type="text" name="agend" value="女" class="border"
											readonly="readonly" class="layui-input">
									</c:if>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">单位:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentid" class="border"
										readonly="readonly" value="${loginuser.getUnit() }"
										class="layui-input">
								</div>
								<label class="layui-form-label">电话:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentid" class="border"
										readonly="readonly" value="${loginuser.getTeachermobile() }"
										class="layui-input">
								</div>
								<%-- <label class="layui-form-label">备注:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentid" class="border"
										readonly="readonly" value="${loginuser.getNote() }"
										class="layui-input">
								</div> --%>
							</div>
						</form>
					</div>
				</div>
			</div>
			<%-- <div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的报名</div>
					<div class="layui-card-body">
						<input type="hidden" id="id" value="${loginuser.getAthletesid() }">
						<table id="demo2" lay-filter="test" lay-skin="nob"></table>
					</div>
				</div>
			</div>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的成绩</div>
					<div class="layui-card-body">
						<input type="hidden" id="id" value="${loginuser.getAthletesid() }">
						<table id="demo" lay-filter="test" lay-skin="nob"></table>
					</div>
				</div>
			</div> --%>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的加油稿</div>
					<div class="layui-card-body">
						<c:forEach items="${oillist }" var="oillist">
							<div>
								<ul>
									<li class="first"
										style="border-bottom: 0.1px solid #9AC0CD;height:50px;line-height:50px;">
										<a href="oneoilingshow.action?oilingid=${oillist.oilingid}">
											<span style="float:left;">【${oillist.oilingtitle }】</span> <span
											style="margin-left:200px;">发布时间：${oillist.createtime }</span>
											<c:if test="${oillist.ischeck == 1}">
												<span style="float:right;margin-right:100px;">状态：未审核</span>
											</c:if> <c:if test="${oillist.ischeck == 2}">
												<span style="float:right;margin-right:100px;">状态：已发布</span>
											</c:if>
									</a>
									</li>
								</ul>
							</div>
						</c:forEach>
					</div>
				</div>
			</div>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">修改密码</div>
					<div class="layui-card-body">
						<%@ include file="updatepwd.jsp"%>
					</div>
				</div>
			</div>
		</c:if>
		<!-- 游客user用户 -->
		<c:if test="${loginuser != null && usertype == 1}">
			<div class="list layui-row layui-col-space12 active">
				<div class="layui-card">
					<div class="layui-card-header">
						<div>
							我的信息 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>我的角色：游客</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
					</div>
					<div class="layui-card-body">
						<form class="layui-form" lay-filter="example">
							<div class="layui-form-item">
								<%-- <label class="layui-form-label">编号:</label>
								<div class="layui-input-inline">
									<input type="text" name="userid" id="userid"
										class="border" readonly="readonly"
										value="${loginuser.getUserid() }" class="layui-input">
								</div> --%>

								<label class="layui-form-label">账号:</label>
								<div class="layui-input-inline">
									<input type="text" name="account" class="border"
										readonly="readonly" value="${loginuser.getUserid() }"
										class="layui-input">
								</div>
								<%-- <label class="layui-form-label">备注:</label>
								<div class="layui-input-inline">
									<input type="text" name="studentid" class="border"
										readonly="readonly" value="${loginuser.getNote() }"
										class="layui-input">
								</div> --%>
							</div>
						</form>
					</div>
				</div>
			</div>
			<%-- <div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的报名</div>
					<div class="layui-card-body">
						<input type="hidden" id="id" value="${loginuser.getUserid() }">
						<table id="demo2" lay-filter="test" lay-skin="nob"></table>
					</div>
				</div>
			</div>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的成绩</div>
					<div class="layui-card-body">
						<input type="hidden" id="id" value="${loginuser.getUserid() }">
						<table id="demo" lay-filter="test" lay-skin="nob"></table>
					</div>
				</div>
			</div> --%>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">我的加油稿</div>
					<div class="layui-card-body">
						<c:forEach items="${oillist }" var="oillist">
							<div>
								<ul>
									<li class="first"
										style="border-bottom: 0.1px solid #9AC0CD;height:50px;line-height:50px;">
										<a href="oneoilingshow.action?oilingid=${oillist.oilingid}">
											<span style="float:left;">【${oillist.oilingtitle }】</span> <span
											style="margin-left:200px;">发布时间：${oillist.createtime }</span>
											<c:if test="${oillist.ischeck == 1}">
												<span style="float:right;margin-right:100px;">状态：未审核</span>
											</c:if> <c:if test="${oillist.ischeck == 2}">
												<span style="float:right;margin-right:100px;">状态：已发布</span>
											</c:if>
									</a>
									</li>
								</ul>
							</div>
						</c:forEach>
					</div>
				</div>
			</div>
			<div class="list">
				<div class="layui-card">
					<div class="layui-card-header">修改密码</div>
					<div class="layui-card-body">
						<%@ include file="updatepwd.jsp"%>
					</div>
				</div>
			</div>
		</c:if>
	</div>
	
		<!-- 没有登录的情况 -->	
		<c:if test="${loginuser == null}">
			<div class="layui-card">
				<div class="layui-card-body" style="text-align:center;">
					<a href="login.jsp">请先登录</a>
				</div>
			</div>
		</c:if>

	<!-- footer部分 -->
	<div class="layui-container" style="width:100%;margin-top:145px;">
		<%@ include file="footer.jsp"%>
	</div>
<script src="res/layui/layui.js"></script>

<script>
layui.use(['table','element','jquery'], function(){
  var table = layui.table;
  var $ = layui.jquery;
  var element = layui.element;//卡片面板引入
	  	$(function(){
			//获取点击事件的对象
			$(".topstyle li").click(function(){
				//获取要显示或隐藏的对象
				var divShow = $(".content").children('.list');
				//判断当前对象是否被选中，如果没选中的话进入if循环
				if (!$(this).hasClass('selected')) {
					//获取当前对象的索引
					var index = $(this).index();
					//当前对象添加选中样式并且其同胞移除选中样式；
					$(this).addClass('selected').siblings('li').removeClass('selected');
					//索引对应的div块显示
					$(divShow[index]).show();
					//索引对应的div块的同胞隐藏
					$(divShow[index]).siblings('.list').hide();
				}
			});
		});
  	
  });
</script>
	<script>
layui.use(['table','jquery'], function(){
  var table = layui.table;
  var $ = layui.jquery;

		
		//第一个实例
		table.render({
			elem : '#demo',
			even : true,
			url : 'aboutproject.action'//数据接口
			,
			page : true //开启分页
			,limits: [10,50,150]
     		,limit: 10 //每页默认显示的数量
			,
			done:function(res){
				console.log(res);
			},
			cols : [ [ //表头
			{
				field : 'athletesid',
				title : '编号',
				width : 130
			}, {
				field : 'athletesname',
				title : '姓名',
				width : 70
			}, {
				field : 'projectname',
				title : '项目',
				width : 145
			}, {
				field : 'collegename',
				title : '学院',
				width : 120
			}, {
				field : 'professionalname',
				title : '专业',
				width : 150
			}, {
				field : 'classname',
				title : '班级',
				width : 160
			}, {
				field : 'itemcategory',
				title : '项目类别',
				width : 90,
				templet : function(d) {
					return d.itemcategory == "1" ? "个人赛" : "集体赛"
				}
			}, {
				field : 'agendtype',
				title : '项目组别',
				width : 90,
				templet : function(d) {
					return d.agendtype == "1" ? "男子组" : "女子组"
				}
			}, {
				field : 'finalresult',
				title : '成绩',
				width : 70
			}, {
				field : 'finalrank',
				title : '名次',
				width : 70
			}

			] ]
		});
		
		
		//第一个实例
		table.render({
			elem : '#demo2',
			even : true,
			url : 'isaboutproject.action'//数据接口
			,
			page : true //开启分页
			,limits: [10,50,150]
     		,limit: 10 //每页默认显示的数量
			,
			done:function(res){
				console.log(res);
			},
			cols : [ [ //表头
			{
				field : 'athletesid',
				title : '编号',
				width : 130
			}, {
				field : 'athletesname',
				title : '姓名',
				width : 120	
			}, {
				field : 'projectname',
				title : '项目',
				width : 160
			}, {
				field : 'collegename',
				title : '学院',
				width : 140
			}, {
				field : 'professionalname',
				title : '专业',
				width : 150
			}, {
				field : 'classname',
				title : '班级',
				width : 160
			}, {
				field : 'itemcategory',
				title : '项目类别',
				width : 120,
				templet : function(d) {
					return d.itemcategory == "1" ? "个人赛" : "集体赛"
				}
			}, {
				field : 'agendtype',
				title : '项目组别',
				width : 120,
				templet : function(d) {
					return d.agendtype == "1" ? "男子组" : "女子组"
				}
			}

			] ]
		});
});
</script>
</body>
</html>